package com.leenmvc.core.security.entity.core;

import com.leenmvc.core.annotation.DbInfo;
import com.leenmvc.core.annotation.PrimaryKey;
import com.leenmvc.core.annotation.validator.Foreign;
import com.leenmvc.core.annotation.validator.Uniqueness;
import com.leenmvc.core.annotation.validator.groups.UpdateGroup;
import com.leenmvc.core.base.BaseEntity;
import com.leenmvc.core.security.dao.core.SysUserDao;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统用户Token
 */
@DbInfo(value = "sys_user_token", comment = "用户TOKEN")
public class SysUserToken extends BaseEntity implements Serializable {

	/**
	 * id
	 */
	@PrimaryKey
	private Long id;
	/**
	 * 用户ID
	 */
	@Foreign(message = "不存在该用户，拒绝更新token", value = SysUserDao.class, groups = {UpdateGroup.class})
	@Uniqueness(message = "用户ID重复，请检查", groups = {UpdateGroup.class})
	private Long userId;
	/**
	 * 用户token
	 */
	private String token;
	/**
	 * uuc 海尔access_token
	 */
	private String uucToken;
	/**
	 * 过期时间
	 */
	private Date expireDate;
	/**
	 * 更新时间
	 */
	private Date updateDate;
	/**
	 * 创建时间
	 */
	private Date createDate;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getUucToken() {
		return uucToken;
	}

	public void setUucToken(String uucToken) {
		this.uucToken = uucToken;
	}

	public Date getExpireDate() {
		return expireDate;
	}

	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
}
